package com.corona.game;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.math.Vector2;
import com.corona.Game;
import com.corona.game.util.TextureCache;
import java.util.HashMap;
import java.util.Map;

/* compiled from: Menu.java */
/* loaded from: pokewilds.jar:com/pkmngen/game/DrawBattleMenu1.class */
class DrawBattleMenu1 extends Action {
    public Action.Layer layer = Action.Layer.gui_129;
    Map<String, Vector2> getCoords = new HashMap();
    Sprite arrow = new Sprite(TextureCache.get(Gdx.files.internal("battle/arrow_right1.png")), 0, 0, 5, 7);
    Vector2 newPos = new Vector2(224.0f, 79.0f);
    String curr = "tl";

    public DrawBattleMenu1(Game game, Action nextAction) {
        super(new Object[0]);
        this.nextAction = nextAction;
        this.arrow.setScale(3.0f);
        this.getCoords.put("tr", new Vector2(368.0f, 79.0f));
        this.getCoords.put("tl", new Vector2(224.0f, 79.0f));
        this.getCoords.put("br", new Vector2(368.0f, 31.0f));
        this.getCoords.put("bl", new Vector2(224.0f, 31.0f));
        this.arrow.setPosition(this.newPos.x, this.newPos.y);
    }

    @Override // com.corona.game.Action
    public String getCamera() {
        return "gui";
    }

    @Override // com.corona.game.Action
    public Action.Layer getLayer() {
        return this.layer;
    }

    @Override // com.corona.game.Action
    public void step(Game game) {
        if (InputProcessor.upPressed) {
            if (this.curr.equals("bl") || this.curr.equals("br")) {
                this.curr = "t" + String.valueOf(this.curr.charAt(1));
                this.newPos = this.getCoords.get(this.curr);
            }
        } else if (InputProcessor.downPressed) {
            if (this.curr.equals("tl") || this.curr.equals("tr")) {
                this.curr = "b" + String.valueOf(this.curr.charAt(1));
                this.newPos = this.getCoords.get(this.curr);
            }
        } else if (InputProcessor.leftPressed) {
            if (this.curr.equals("tr") || this.curr.equals("br")) {
                this.curr = String.valueOf(this.curr.charAt(0)) + "l";
                this.newPos = this.getCoords.get(this.curr);
            }
        } else if (InputProcessor.rightPressed && (this.curr.equals("tl") || this.curr.equals("bl"))) {
            this.curr = String.valueOf(this.curr.charAt(0)) + "r";
            this.newPos = this.getCoords.get(this.curr);
        }
        if (Gdx.input.isKeyPressed(54)) {
            if (this.curr.equals("tl")) {
                game.insertAction(new ThrowRock(game, this));
                game.actionStack.remove(this);
            }
            if (this.curr.equals("br")) {
                game.insertAction(new BattleFadeOut(game, new WaitFrames(game, 18, new DisplayText(game, "Got away safely!", (String) null, (Action) null, (Action) null))));
                game.insertAction(new BattleFadeOutMusic(game, null));
                game.insertAction(new PlayMusic("click1", new PlayMusic("run1", (Action) null)));
                game.actionStack.remove(this);
                game.battle.drawAction.cleanup(game);
                game.battle.oppPokemon.inBattle = false;
            }
        }
        this.arrow.setPosition(this.newPos.x, this.newPos.y);
        this.arrow.draw(game.uiBatch);
    }
}
